import request from "@/request/api";

//作业风险库接口
//1.风险源查询接口
export function queryRiskSourceList(data) {
  return request({
    url: "/eam-service-standard/riskSources/page",
    method: "get",
    params: data,
  });
}
// 风险源保存接口
export function addRiskSource(data) {
  return request({
    url: "/eam-service-standard/riskSources",
    method: "post",
    data: data,
  });
}
// 风险源更新接口
export function updateRiskSource(data) {
  return request({
    url: "/eam-service-standard/riskSources",
    method: "put",
    data: data,
  });
}
// 风险源删除接口
export function deleteRiskSource(data) {
  return request({
    url: "/eam-service-standard/riskSources",
    method: "delete",
    params: data,
  });
}
//同步风险源的数据
export function synchronizeRiskSource(data) {
  return request({
    url: "/eam-service-standard/riskSources/sync",
    method: "put",
    data: data,
  });
}

//查询风险源类别
export function queryRiskSourceType(data) {
  return request({
    url: "/eam-service-standard/riskSources/types",
    method: "get",
    params: data,
  });
}
//根据风险源id查询风险项
export function queryRiskItemBySourceId(data) {
  return request({
    url: "/eam-service-standard/riskItem/listItems",
    method: "get",
    params: data,
  });
}
//风险项新增接口
export function addRiskItem(data) {
  return request({
    url: "/eam-service-standard/riskItem",
    method: "post",
    data: data,
  });
}
// 风险项更新接口
export function updateRiskItem(data) {
  return request({
    url: "/eam-service-standard/riskItem",
    method: "put",
    data: data,
  });
}
// 风险项删除接口
export function deleteRiskItem(data) {
  return request({
    url: "/eam-service-standard/riskItem",
    method: "delete",
    params: data,
  });
}
// 风险库导入接口
export function importRisk(data,formData) {
  return request({
    url: "/eam-service-standard/riskSources/import",
    method: "post",
    params: data,
    data: formData,
  });
}

